<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="/js/task_view.js"></script>
<head th:include="/base/common_css('test')">
<body>
<div th:include="/base/common_banner"></div>
<!-- Main content starts -->

<div class="content">
    <!-- Sidebar -->
    <div th:include="/base/common_menu"></div>
    <!-- Sidebar
    <div class="sidebar">
        <div class="sidebar-dropdown"><a href="#">Navigation</a></div>

    </div>-->
    <!-- Matter -->
    <div class="mainbar">
        <!-- Page heading -->
        <div th:include="/base/common_pageHeader"></div>

        <div class="matter">
            <div class="container">
                <div class="row">
                    <div class="col-md-6">


                        <div class="widget wgreen">

                            <div class="widget-head">
                                <div class="pull-left">编辑礼包信息</div>
                                <div class="widget-icons pull-right">
                                    <a href="#" class="wminimize"><i class="icon-chevron-up"></i></a>
                                    <a href="#" class="wclose"><i class="icon-remove"></i></a>
                                </div>
                                <div class="clearfix"></div>
                            </div>

                            <div class="widget-content">
                                <div class="padd">

                                    <!-- Form starts.  -->
                                    <form class="form-horizontal" role="form" action="#" method="post">

                                        <div class="modal-body">
                                            <form action="#" method="post"
                                                  enctype="multipart/form-data">
                                                <input class="col-lg-4 form-control " type="hidden" id="taskId"
                                                       th:value="${taskInfo.id}">
                                                <!--当类型为“签到”类型时，只允许修改奖励数据-->
                                                <div th:hidden=" ${taskInfo.giftType==1}">
                                                    <!---->
                                                    <div class="form-group">
                                                        <label class="col-lg-4 control-label" style="width: 110px;">
                                                            礼包类型
                                                            (*) </label>
                                                        <div class="col-lg-8">
                                                            <select id="giftType"
                                                                    class="selectpicker show-tick form-control"
                                                                    placeholder="礼包类型"
                                                                    th:if="${taskInfo.giftType != 1}">
                                                                <option th:each="giftTypes:${giftTypeMap1}"
                                                                        th:value="${giftTypes.key}"
                                                                        th:text="${giftTypes.value}"
                                                                        th:selected="${giftTypes.key == taskInfo.giftType}"></option>
                                                            </select>
                                                            <select id="giftType"
                                                                    class="selectpicker show-tick form-control"
                                                                    placeholder="礼包类型"
                                                                    th:if="${taskInfo.giftType == 1}">
                                                                <option th:value="1"
                                                                        th:text="签到" selected></option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="col-lg-4 control-label" style="width: 110px;">
                                                            礼包名称
                                                            (*) </label>
                                                        <div class="col-lg-8">
                                                            <input type="text" th:value="${taskInfo.giftName}"
                                                                   class="form-control"
                                                                   id="giftName" placeholder="礼包名称">
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="col-lg-4 control-label"
                                                               style="width: 110px;">序号</label>
                                                        <div class="col-lg-8">
                                                            <input type="text" th:value="${taskInfo.taskOrder}"
                                                                   class="form-control"
                                                                   id="taskOrder" placeholder="序号">
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="col-lg-4 control-label" style="width: 110px;">
                                                            礼包描述
                                                            (*) </label>
                                                        <div class="col-lg-8">
                                                        <textarea th:text="${taskInfo.taskDesc}" class="form-control"
                                                                  id="taskDesc" placeholder="礼包描述"></textarea>
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="col-lg-4 control-label" style="width: 110px;">
                                                            领取条件
                                                            (*) </label>
                                                        <div class="col-lg-8">
                                                            <select id="requireType"
                                                                    class="selectpicker show-tick form-control">
                                                                <option th:each="requireTypes:${requireTypeMap}"
                                                                        th:value="${requireTypes.key}"
                                                                        th:text="${requireTypes.value}"
                                                                        th:selected="${requireTypes.key == taskInfo.requireType}"></option>
                                                            </select>

                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="col-lg-4 control-label" style="width: 110px;">
                                                            条件数量 </label>
                                                        <div class="col-lg-8">
                                                            <input type="text" th:value="${taskInfo.requireCount}"
                                                                   class="form-control"
                                                                   id="requireCount" placeholder="条件数量">
                                                        </div>
                                                    </div>
                                                    <div class="form-group">
                                                        <label class="col-lg-4 control-label" style="width: 110px;">
                                                            重置周期
                                                            (*) </label>
                                                        <div class="col-lg-8">
                                                            <select id="resetDays"
                                                                    class="selectpicker show-tick form-control">
                                                                <option th:each="cycles:${cycleMap}"
                                                                        th:value="${cycles.key}"
                                                                        th:text="${cycles.value}"
                                                                        th:selected="${cycles.key == taskInfo.resetDays}"></option>
                                                            </select>

                                                        </div>
                                                    </div>

                                                </div>
                                                <div class="form-group">
                                                    <label class="col-lg-4 control-label" style="width: 110px;"> 礼包奖励-1
                                                        (*) </label>
                                                    <div class="col-lg-8">
                                                        <select id="prizeType1"
                                                                class="selectpicker show-tick form-control">
                                                            <option th:each="prizeTypes:${prizeTypeMap}"
                                                                    th:value="${prizeTypes.key}"
                                                                    th:text="${prizeTypes.value}"
                                                                    th:selected="${prizeTypes.key == taskInfo.prizeType1}"></option>
                                                        </select>

                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-lg-4 control-label" style="width: 110px;">
                                                        奖励数量 </label>
                                                    <div class="col-lg-8">
                                                        <input type="text" th:value="${taskInfo.prizeCount1}"
                                                               class="form-control"
                                                               id="prizeCount1" placeholder="奖励数量">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-lg-4 control-label" style="width: 110px;">
                                                        礼包奖励-2 </label>
                                                    <div class="col-lg-8">
                                                        <select id="prizeType2"
                                                                class="selectpicker show-tick form-control">
                                                            <option th:each="prizeTypes:${prizeTypeMap}"
                                                                    th:value="${prizeTypes.key}"
                                                                    th:text="${prizeTypes.value}"
                                                                    th:selected="${prizeTypes.key == taskInfo.prizeType2}"></option>
                                                        </select>

                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-lg-4 control-label" style="width: 110px;">
                                                        奖励数量 </label>
                                                    <div class="col-lg-8">
                                                        <input type="text" th:value="${taskInfo.prizeCount2}"
                                                               class="form-control"
                                                               id="prizeCount2" placeholder="奖励数量">
                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-lg-4 control-label" style="width: 110px;">
                                                        礼包奖励-3 </label>
                                                    <div class="col-lg-8">
                                                        <select id="prizeType3"
                                                                class="selectpicker show-tick form-control">
                                                            <option th:each="prizeTypes:${prizeTypeMap}"
                                                                    th:value="${prizeTypes.key}"
                                                                    th:text="${prizeTypes.value}"
                                                                    th:selected="${prizeTypes.key == taskInfo.prizeType3}"></option>
                                                        </select>

                                                    </div>
                                                </div>
                                                <div class="form-group">
                                                    <label class="col-lg-4 control-label" style="width: 110px;">
                                                        奖励数量 </label>
                                                    <div class="col-lg-8">
                                                        <input type="text" th:value="${taskInfo.prizeCount3}"
                                                               class="form-control"
                                                               id="prizeCount3" placeholder="奖励数量">
                                                    </div>
                                                </div>
                                            </form>
                                        </div>
                                    </form>
                                    <div class="modal-footer">
                                        <button type="button" onclick="saveTask()"
                                                class="btn btn-success">保存
                                        </button>
                                        <button type="button" class="btn btn-cancel" onclick="cancles()">取消
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<!-- Mainbar ends -->
<div class="clearfix"></div>

</div>
<!-- Content ends -->

<div th:include="/base/common_footer"></div>
<!-- Scroll to top -->
<span class="totop"><a href="#"><i class="icon-chevron-up"></i></a></span>
<!--js????-->
<div th:include="/base/common_js"></div>
<script type="text/javascript">

</script>

</body>
</html>